//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.ligson.springbootrestdao.event;

import org.springframework.context.ApplicationEvent;

import java.util.LinkedList;
import java.util.List;

public class EntityModifyEvent extends ApplicationEvent {
    private Class entityClazz;
    private Object entityInstance;
    private String entityId;
    private EntityModifyEvent.ModifyType modifyType;
    private List<ModifyProperty> oldProperties = new LinkedList();
    private List<ModifyProperty> properties = new LinkedList();

    public EntityModifyEvent(Object source, Class entityClazz, Object entityInstance, String entityId, EntityModifyEvent.ModifyType modifyType, List<ModifyProperty> oldProperties, List<ModifyProperty> properties) {
        super(source);
        this.entityClazz = entityClazz;
        this.entityInstance = entityInstance;
        this.entityId = entityId;
        this.modifyType = modifyType;
        this.oldProperties = oldProperties;
        this.properties = properties;
    }

    public Class getEntityClazz() {
        return this.entityClazz;
    }

    public Object getEntityInstance() {
        return this.entityInstance;
    }

    public String getEntityId() {
        return this.entityId;
    }

    public EntityModifyEvent.ModifyType getModifyType() {
        return this.modifyType;
    }

    public List<ModifyProperty> getOldProperties() {
        return this.oldProperties;
    }

    public List<ModifyProperty> getProperties() {
        return this.properties;
    }

    public void setEntityClazz(final Class entityClazz) {
        this.entityClazz = entityClazz;
    }

    public void setEntityInstance(final Object entityInstance) {
        this.entityInstance = entityInstance;
    }

    public void setEntityId(final String entityId) {
        this.entityId = entityId;
    }

    public void setModifyType(final EntityModifyEvent.ModifyType modifyType) {
        this.modifyType = modifyType;
    }

    public void setOldProperties(final List<ModifyProperty> oldProperties) {
        this.oldProperties = oldProperties;
    }

    public void setProperties(final List<ModifyProperty> properties) {
        this.properties = properties;
    }

    public String toString() {
        return "EntityModifyEvent(entityClazz=" + this.getEntityClazz() + ", entityInstance=" + this.getEntityInstance() + ", entityId=" + this.getEntityId() + ", modifyType=" + this.getModifyType() + ", oldProperties=" + this.getOldProperties() + ", properties=" + this.getProperties() + ")";
    }

    public static enum ModifyType {
        NEW,
        UPDATE,
        DELETE,
        PRE_NEW,
        PRE_UPDATE,
        PRE_DELETE;

        private ModifyType() {
        }
    }
}
